from django.conf.urls.defaults import *
from django.views.generic import list_detail
from b9c.sign_generator.models import Sign
from django.conf import settings

sign_info = {
    'queryset': Sign.objects.all(),
}


# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^b9c/', include('b9c.foo.urls')),
    (r'^new/$', 'sign_generator.views.new'),
    (r'^signs/list/$', list_detail.object_list, sign_info),
    (r'^signs/(?P<slug>[-\w]+)/zip/$', 'sign_generator.views.returnZipFile'),
    (r'^signs/(?P<slug>[-\w]+)/$', list_detail.object_detail, sign_info),

    # Uncomment the admin/doc line below to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
)


if settings.DEBUG:
    urlpatterns += patterns('',
        url(r'^cache/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.CACHE_DIR,
        }),
        url(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': settings.SITE_MEDIA_ROOT,
        }),

   )

